"use strict";
/**
 * 数据类型 ：枚举 enum
 *
 * 语法
 *  enum 枚举名{
 *      枚举项1 = 枚举值1,
 *      枚举项2 = 枚举值2,
 *      ....
 * }
 *
 * 默认枚举值时；枚举值从 0 开始
 *
 * 枚举项：一般用英文和数字
 * 枚举值: 一般用整型数字
 *
 *
 */
// 声明枚举
var GunType;
(function (GunType) {
    GunType[GunType["M416"] = 1] = "M416";
    GunType[GunType["AK47"] = 2] = "AK47";
    GunType[GunType["Goza"] = 3] = "Goza";
})(GunType || (GunType = {}));
console.log(GunType);
// 省略枚举值
var GunType1;
(function (GunType1) {
    GunType1[GunType1["M416"] = 0] = "M416";
    GunType1[GunType1["AK47"] = 1] = "AK47";
    GunType1[GunType1["Goza"] = 2] = "Goza";
})(GunType1 || (GunType1 = {}));
console.log(GunType1);
// 使用枚举解决问题
//声明性别枚举
var Gender;
(function (Gender) {
    Gender[Gender["Boy"] = 1] = "Boy";
    Gender[Gender["Girl"] = 2] = "Girl";
    Gender[Gender["Unknow"] = 3] = "Unknow";
})(Gender || (Gender = {}));
//创建 用户性别变量
let userSex = Gender.Boy;
console.log(userSex);
//判断 变量中的性别是否为 Boy
if (userSex == Gender.Boy) {
    console.log(userSex);
}
else {
    console.log(userSex);
}
